<?php /* Smarty version 2.6.11, created on 2011-06-23 12:42:43
         compiled from classify_main.php */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'math', 'classify_main.php', 62, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style/css/common.css" type="text/css" />
<title>分类管理</title>
<SCRIPT src="style/js/jquery-1.3.2.min.js" type=text/javascript></SCRIPT>
<SCRIPT src="style/js/main.js" type=text/javascript></SCRIPT>
<SCRIPT src="style/js/jquery-ui-1.7.2.custom.min.js" type=text/javascript></SCRIPT>
<LINK href="style/css/jquery-ui-1.7.2.custom.min.css" type=text/css rel=stylesheet>
<script language="javascript">
$(document).ready(function(){
	$(".cbg").hover(function(){$(this).css("background-color","#F3F8F7")},function(){$(this).css("background-color","")});
});
</script>
</head>
<body>
<div id="man_zone">
<form action="index.php?m=classify&a=add" method="post">
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table_style">
  <tr>
    <td colspan="2" style="text-align:left;" class="left_title_1">添加分类</td>
    </tr>
  <tr>
    <td>分类名称:</td>
    <td><label for="textfield">
      <input type="text" name="name" id="name" /></label>
    </td>
  </tr>
  <tr>
    <td bgcolor="#F9F9F9">隶属大类:</td>
    <td><label for="select">
      <select name="pid" id="pid">
        <option value="0" selected="selected">无(作为一级分类)</option>
        <?php $_from = $this->_tpl_vars['classify']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['val']):
?>
        <?php if ($this->_tpl_vars['val']['level'] == 0): ?>
        <?php $this->assign('cid', $this->_tpl_vars['arg']['cid']); ?>
        <option value="<?php echo $this->_tpl_vars['val']['cid']; ?>
"<?php if ($this->_tpl_vars['cid'] == $this->_tpl_vars['val']['cid'] || $this->_tpl_vars['classify']['c'][$this->_tpl_vars['cid']]['pid'] == $this->_tpl_vars['val']['cid']): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['val']['name']; ?>
</option>
        <?php endif; ?>
        <?php endforeach; endif; unset($_from); ?>
      </select></label></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="提交" /></td>
  </tr>
</table>
</form>
<br />
<table  width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table_style">
  <tr>
    <td colspan="4" style="text-align:left;" class="left_title_1">编辑分类</td>
  </tr>
  <tr align="center">
    <td>id</td>
    <td>分类名称</td>
    <td>操作</td>
  </tr>
	<?php $_from = $this->_tpl_vars['classify']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['val']):
?>
	<tr class="cbg">
        <td align="center"><?php echo $this->_tpl_vars['val']['cid']; ?>
</td>
        <?php echo smarty_function_math(array('equation' => "(x+y)*z",'x' => $this->_tpl_vars['val']['level'],'y' => 1,'z' => 20,'assign' => 'padding'), $this);?>

        <td style="padding-left:<?php echo $this->_tpl_vars['padding']; ?>
px;">
            <div id="name_<?php echo $this->_tpl_vars['val']['cid']; ?>
">
                |-- <a href="index.php?m=website&cid=<?php echo $this->_tpl_vars['val']['cid']; ?>
"><?php echo $this->_tpl_vars['val']['name']; ?>
</a>
            </div>
        </td>
        <td align="center">
            <a href="javascript:;" class="rename" cid="<?php echo $this->_tpl_vars['val']['cid']; ?>
" name="<?php echo $this->_tpl_vars['val']['name']; ?>
" id="rename_<?php echo $this->_tpl_vars['val']['cid']; ?>
">重命名</a> 
            <a href="index.php?m=classify&amp;a=delete&amp;cid=<?php echo $this->_tpl_vars['val']['cid']; ?>
&pid=<?php echo $this->_tpl_vars['val']['cid']; ?>
" class="delete">删除</a>
        </td>
      </tr>
      <?php $this->assign('cid', $this->_tpl_vars['val']['cid']); ?>
      <?php $_from = $this->_tpl_vars['websites'][$this->_tpl_vars['cid']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['value']):
?>
      	<tr class="cbg">
        <td align="center"></td>
        <td style="padding-left:<?php echo smarty_function_math(array('equation' => "(x+y)",'x' => $this->_tpl_vars['padding'],'y' => 20), $this);?>
px;">
            └-- <a href="index.php?m=website&a=attribute&wid=<?php echo $this->_tpl_vars['value']['wid']; ?>
"><?php echo $this->_tpl_vars['value']['domain']; ?>
</a>
        </td>
        <td align="center">
            
        </td>
      </tr>
      <?php endforeach; endif; unset($_from); ?>
    <?php endforeach; endif; unset($_from); ?>
  <tr>
    <td colspan="4"></td>
  </tr>
</table>
</div>

<DIV id=init_page_dialog title="重命名" style="display:none;">
        <input type="text" id="renameInput" value="" class="size" />
        </DIV>
        
        <DIV id="moveDialog" title="重命名" style="display:none;">
        <label for="select">请选择目标分类:
        <select name="pid" id="pid">
        <option value="0" selected="selected">无(作为一级分类)</option>
        <?php $_from = $this->_tpl_vars['classify']['p']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['val']):
?>
        <option value="<?php echo $this->_tpl_vars['val']['cid']; ?>
"><?php echo $this->_tpl_vars['val']['name']; ?>
</option>
        <?php endforeach; endif; unset($_from); ?>
        </select></label>
        </DIV>
</body>
</html>